<template>
  <div class="Login">
    <div class="wrap">
      <el-form label-width="80px" style="width: 100%">
        <el-form-item :label="$t('login.account')">
          <el-input v-model="userName" :placeholder="$t('login.accountPlace')"></el-input>
        </el-form-item>
        <el-form-item :label="$t('login.password')" style="margin: 0">
          <el-input v-model="passWord" :placeholder="$t('login.passwordPlace')"></el-input>
        </el-form-item>
        <el-form-item class="mar_top5">
          <div class="row_cen font_size12" style="line-height: 1.5em">{{$t('contactTips')}}：010-1234567</div>
        </el-form-item>
        <el-form-item style="margin: 0">
          <el-button size="medium" type="primary" style="background-color: black;border-color: black;width: 100%"
                     @click="loginFun()">{{$t('loginText')}}</el-button>
        </el-form-item>
      </el-form>
    </div>
  </div>
</template>

<script>
import {apiLogin} from "../Api/http/api";
export default {
  name: "Login",
  //created创建完毕状态
  created() {
  },
  data() {
    return {
      userName:"",
      passWord:"",
    }
  },
  //事件处理
  methods: {
    loginFun(){
      sessionStorage.setItem('userLoginInfo',"{userName:'张三',userId:'475756478462'}");
      const pathUrl = this.$route.query.redirect || '/';
      this.$router.replace({
        path: pathUrl,
      })
      apiLogin({}).then((succ)=>{
        if(succ.code === 0){
          console.log('succ==',succ);
        }
      })
    },
  },
}
</script>

<style lang="scss" scoped>
.Login {
  width: 100%;
  height: 100%;
  background: url("../../src/assets/img/login_bg.84104cd.png") no-repeat;
  background-size: 100% 100%;
  position: absolute;
  left: 0;
  top: 0;
}
.wrap{
  width: 370px;
  height: 330px;
  box-shadow: 0 0 8px 0 #232323;
  padding-left: 30px;
  padding-right: 65px;
  display: flex;
  align-items: center;
  background-color: #ffffff;
  border-radius: 6px;
  position: fixed;
  top: 50%;
  right: 8%;
  transform: translate(0, -50%);
  z-index: 9;
}
</style>
